The code attached contains the model H2-CH4-OH-CO used to obtain the results of Bertagni et al., 2022 (Nat. Comm.).
The code runs on Wolfram Mathematica (successfully tested on versions 11,12,13).
To install Wolfram Mathematica: https://www.wolfram.com/mathematica/

The code is well commented, and color codes have been used to make the file more intuitive:

1. Gray: definition of the parameters and the unperturbed steady state.
2. Light blue: linear stability analysis and transient dynamics
3. Green: equilibrium scenarios for H2 replacement of fossil fuel energy.

To run the code, it is necessary to first run the gray section to define the parameters. 
Then either the blue (transient dynamics) or green (equilibrium) sections.
Clear the kernel to run the gray+green sections after having run the gray+blue sections (or vice-versa).

The code is already set to reproduce all results presented in the manuscript by simply running the different sections.


Contact M.B. Bertagni (matteobb@princeton.edu) for any question or feedback.